home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Shareware World / Info / For Developers / Smile1.6.6.sea / Smile1.6.6 / Smile ƒ / Help files / Scripts menu < prev    next >
Text File  |  1999-08-08  |  6KB  |  86 lines

  1. The Scripts Menu
  2.  
  3.  
  4. What is the Script menu ?
  5.  
  6. The "Scripts" menu provides a way to make a script launchable by menu. Smile's mechanism for the "Scripts" menu supports sub-menus and shortcuts.
  7.  
  8. You can also make your favorite documents and custom dialogs openable by this menu.
  9.  
  10.  
  11. Using the "Scripts" menu - The "User Scripts" folder.
  12.  
  13. The "Scripts" menu (the menu with the parchment Script icon) displays the scripts contained in the "User Scripts" folder. (The scripts contained in the "User scripts" folder are called user scripts.) Folders are listed as sub-menus. Selecting one of the menu items of the "Scripts" menu launches the corresponding script.
  14.  
  15. The "Scripts" menu also displays the names of any document or custom dialog contained in the "User Scripts" folder. Selecting one of those will open the corresponding document: dialog or text document, mainly.
  16.  
  17. Instead of moving files and folders in and out of the "User Scripts" folder, you may copy aliases of your favorite files / folders in this folder.
  18.  
  19.  
  20. Adding / Removing a menu item
  21.  
  22. To add or remove an item to / from the "Scripts" menu, add or remove the corresponding file to / from the "User scripts" folder. You do not need to quit Smile, changes take effect immediately.
  23.  
  24. To add or remove a sub-menu, add or remove the corresponding folder from the "User scripts" folder. "Sclipts" and "Dialog" ("Advanced stuff" folder) are examples of folders of scripts, which can be copied to the "User scripts" to install a group of commands. 
  25.  
  26.  
  27. Naming a menu item - The shortcuts
  28.  
  29. If the name of a script of the "User scripts" folder ends with the slash character, followed by another character (for instance "/@"), the final character ("@" in the example) can be used, in combination with the Command key (), as a keyboard shortcut for selecting the menu.
  30.  
  31. The shortcut is case-sensitive. If the final character of the name of the script is a low case character (for instance, "Test /t"), the shortcut combination is simply Command-key (for instance,  T). If the final character is an uppercase character (for instance, "Test /T"), the shortcut combination is Command-Shift-key (for instance,  T).
  32.  
  33. If this shortcut is a figure ("0" ... "9"), you must use the numeric keypad to activate it. You can also use the function keys to activate such shortcuts : see keyboard shortcuts.
  34.  
  35.  
  36. Editing a user script
  37.  
  38. To edit/view a user script, choose its name in the "Scripts" menu while pressing the Option key down ().
  39.  
  40. Of course, you can also use the standard procedure for opening scripts. See "File" menu.
  41.  
  42.  
  43. The default user scripts
  44.  
  45. Smile ships with a default "Scripts" menu containing a few user scripts. This default "Scripts" menu can depend on what version you have installed. Below is described the "Scripts" menu installed with Smile 1.6.4. Additional user scripts can be found in the "Advanced stuff" folder.
  46.  
  47. • Display selection length
  48. This menu is very convenient to perform counting operations on text. It is also provided as a sample of custom dialog.
  49.  
  50. When you select the menu, a dialog box named "Selection" opens. It displays two integers. The first one is the index of the start of the current selection of the active window. The second one is, either the index of the end of the current selection of the active window, or its length, depending on the setting of the "Length" checkbox.
  51.  
  52. The two fields are updated, when the dialog box opens, when you click "Refresh" or, automatically, if the "auto" checkbox is checked.
  53.  
  54. If you enter a new value in either field, the selection of the active window changes accordingly. The fields can be toggled by depressing the Tab key.
  55.  
  56. • Duplicate        D    
  57. The effect of this command depends on what is selected.
  58.  
  59. - If the front window is a text or script window and no text is selected, this command duplicates the window and its contents. This can be very useful to test an important change in a script while maintaining a reference copy of the original script. 
  60.  
  61. - If the front window is a text or script window, and some text is selected, selecting "Duplicate" will duplicate the selected text. This is the same as executing the sequence "Copy - Paste", except it does not use the clipboard. Use "Duplicate" any time you want to duplicate a piece of text without losing the Clipboard's contents. 
  62.  
  63. - If the front window is a dialog window in edit mode, and one dialog item at least is selected, then "Duplicate" will duplicate the selected dialog item(s). "Duplicate" can be very useful for building up a Custom dialog. For example, once you have made a button with the right font and bounds, you may want to duplicate it instead of creating and setting a new one. 
  64.  
  65. - If no window is open, selecting "Duplicate" will just beep.
  66.  
  67. • Make output window    -" " (space bar)
  68. Select this menu to open a new output window to the active window. If it has already one, the menu will reveal it.
  69.  
  70. • Save a copy as …
  71. Many users have suggested such a command. It is now available as a user menu. It can be used, for instance, while developing a run-only applet, to save editable copies of the script.
  72.  
  73. ========================================================
  74.  
  75. Advanced
  76.  
  77. • The menu names follow the rules of Menu Manager. Use the reserved characters ("<", "(", "-", etc. ) only if you know what you are doing.
  78.  
  79. • The "Scripts" menu is updated the first time the user clicks in the menu bar after the "User scripts" folder has been modified. (A folder is not considered modified when one of its file gets renamed.)
  80.  
  81. • When a user script is running, its path name is available in the "user script file" property of Smile.
  82.  
  83. • If the "User Scripts" folder contains aliases, the "Scripts" menu lists the names of the original files. The list is alphabetical but it is sorted according, not to the original file names, but to the names of these aliases. Yet, it is the original file name which is displayed in the menu. This can be used to cutomize the order of the menu list. You may want to make aliases to a script named "-" to insert separator lines.
  84.  
  85. ========================================================
  86.